﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:Get ID="ThisChannel" Object="Channel" InnerID="Request.QueryString['ID']" Validate="True" />
<script language="c#" runat="server">
protected string CurrentModuleID
{
	get
	{
		object instanceID = ThisChannel[AliCMS.SystemModule.Alias.Channel.InstanceID];
		if (Guid.Equals(instanceID, Guid.Empty))
			return Guid.Empty.ToString();
		
		DataRow[] rows = Manager.Channels.Select(AliCMS.SystemModule.Alias.Instance.ID + "='" + instanceID + "'");
		return rows[0][AliCMS.SystemModule.Alias.Module.ID].ToString();
	}
}
</script>
<section data-page="channel_edit" data-title="编辑栏目" data-lang="<%=ContentLang%>" data-id="<%=Request.QueryString["ID"]%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">栏目列表</a> → <b class="<%=ContentLang%>Font"><%=ThisChannel[Name]%></b></dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li class="ali-active"><a>编辑</a></li>
							<%If !Convert.IsDBNull(ThisChannel[TemplatePath])%>
								<li><a href="change_template.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>" target="ali-navtab">更改模板</a></li>
								<li><a href="extra_instance.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>" target="ali-navtab">栏目邦定</a></li>
							<%EndIf%>
							<%If Convert.ToBoolean(ThisChannel[EnableMenu])%>
								<li><a href="menu/list.aspx?Lang=<%=ContentLang%>&amp;ChannelID=<%=Request.QueryString["ID"]%>" target="ali-navtab">栏目菜单</a></li>
								<li><a href="menu/add.aspx?Lang=<%=ContentLang%>&amp;ChannelID=<%=Request.QueryString["ID"]%>" target="ali-navtab">添加菜单</a></li>
							<%EndIf%>
						</ul>
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th>类型：</th>
								<td>
									<%If Convert.IsDBNull(ThisChannel[TemplatePath])%>
										<input type="radio" name="Type" value="Functional" disabled>功能栏目
										<input type="radio" name="Type" value="NonFunctional" disabled>非功能栏目
										<input type="radio" name="Type" value="OuterLink" disabled checked>外部链接
									<%ElseIf Guid.Equals(ThisChannel[InstanceID], Guid.Empty)%>
										<input type="radio" name="Type" value="Functional" disabled>功能栏目
										<input type="radio" name="Type" value="NonFunctional" disabled checked>非功能栏目
										<input type="radio" name="Type" value="OuterLink" disabled>外部链接
									<%Else%>
										<input type="radio" name="Type" value="Functional" disabled checked>功能栏目
										<input type="radio" name="Type" value="NonFunctional" disabled>非功能栏目
										<input type="radio" name="Type" value="OuterLink" disabled>外部链接
									<%EndIf%>
								</td>
							</tr>
							<%If !Guid.Equals(ThisChannel[InstanceID], Guid.Empty)%>
								<tr>
									<th>实例：</th>
									<td>
										<ali:List Object="Instance" Condition="ModuleID=CurrentModuleID">
											<select name="InstanceID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
												<ali:Record>
													<%If Guid.Equals(ThisChannel[InstanceID], ID)%>
														<option value="<%=ID%>" selected><%=Name%></option>
													<%Else%>
														<option value="<%=ID%>"><%=Name%></option>
													<%EndIf%>
												</ali:Record>
											</select>
										</ali:List>
									</td>
								</tr>
							<%EndIf%>
							<tr>
								<th>父栏目：</th>
								<td>
									<select name="ParentID" data-class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="">
										<option value="" data-item="" data-parent="">未指定</option>
										<ali:Tree Object="Channel" Lang="ContentLang">
											<ali:Record>
												<%If Guid.Equals(ID, ThisChannel[ParentID])%>
													<option value="<%=ID%>" selected data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>"><%=Name%></option>
												<%Else%>
													<option value="<%=ID%>" data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>"><%=Name%></option>
												<%EndIf%>
												<%=ChildRecords%>
											</ali:Record>
										</ali:Tree>
									</select>
								</td>
							</tr>
							<tr>
								<th>名称：</th>
								<td><input type="text" name="Name" value="<%=ThisChannel[Name]%>" size="50" maxlength="150" class="ali-input <%=ContentLang%>Font"></td>
							</tr>
							<tr>
								<th>路径：</th>
								<td><input type="text" name="Path" value="<%=ThisChannel[Path]%>" size="50" maxlength="255" class="ali-input" data-old="<%=ThisChannel[Path]%>"><p></p></td>
							</tr>
							<%If !Convert.IsDBNull(ThisChannel[TemplatePath])%>
								<tr>
									<th>是否动态模板：</th>
									<td>
										<%If Convert.ToBoolean(ThisChannel[IsDynamicTemplate])%>
											<label><input type="radio" name="IsDynamicTemplate" value="true" checked>是</label>
											<label><input type="radio" name="IsDynamicTemplate" value="false">否</label>
										<%Else%>
											<label><input type="radio" name="IsDynamicTemplate" value="true">是</label>
											<label><input type="radio" name="IsDynamicTemplate" value="false" checked>否</label>
										<%EndIf%>
										<ol style="display:none">
											<li>如果是动态模板，并且栏目路径中没有正则表达式，则设置name为ID，value为栏目路径后的第一个目录名称。</li>
											<li>如果是动态模板，并且栏目路径中包含正则表达式，则设置name为正则名称，value为正则匹配值。</li>
											<li>动态模板实例所属的模块的InstanceConfig对象必须包含GetDynamicTemplate的函数。</li>
										</ol>
									</td>
								</tr>
								<tr<%If !Convert.ToBoolean(ThisChannel[IsDynamicTemplate])%> style="display:none"<%EndIf%>>
									<th>动态模板实例：</th>
									<td>
										<ali:List ID="Instance" Object="Instance" Sort="InnerID DESC">
											<select name="DynamicInstanceID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
												<ali:Record>
													<%If Guid.Equals(ThisChannel[DynamicInstanceID], ID)%>
														<option value="<%=ID%>" selected><%=Name%></option>
													<%Else%>
														<option value="<%=ID%>"><%=Name%></option>
													<%EndIf%>
												</ali:Record>
											</select>
										</ali:List>
									</td>
								</tr>
								<%If Convert.ToBoolean(ThisChannel[Generate])%>
									<tr>
										<th>是否生成：</th>
										<td>
											<label><input type="radio" name="Generate" value="true" checked>是</label>
											<label><input type="radio" name="Generate" value="false">否</label>
										</td>
									</tr>
									<tr>
										<th>缓存时间：</th>
										<td><input type="text" name="Duration" value="<%=ThisChannel[Duration]%>" size="10" maxlength="10" class="ali-input"></td>
									</tr>
									<tr>
										<th>GZip压缩：</th>
										<td>
											<%If Convert.ToBoolean(ThisChannel[GZipEnabled])%>
												<label><input type="radio" name="GZipEnabled" value="true" checked>启用</label>
												<label><input type="radio" name="GZipEnabled" value="false">禁用</label>
											<%Else%>
												<label><input type="radio" name="GZipEnabled" value="true">启用</label>
												<label><input type="radio" name="GZipEnabled" value="false" checked>禁用</label>
											<%EndIf%>
										</td>
									</tr>
								<%Else%>
									<tr>
										<th>是否生成：</th>
										<td>
											<label><input type="radio" name="Generate" value="true">是</label>
											<label><input type="radio" name="Generate" value="false" checked>否</label>
										</td>
									</tr>
									<tr style="display:none">
										<th>缓存时间：</th>
										<td><input type="text" name="Duration" value="<%=ThisChannel[Duration]%>" size="10" maxlength="10" class="ali-input"></td>
									</tr>
									<tr style="display:none">
										<th>GZip压缩：</th>
										<td>
											<%If Convert.ToBoolean(ThisChannel[GZipEnabled])%>
												<label><input type="radio" name="GZipEnabled" value="true" checked>启用</label>
												<label><input type="radio" name="GZipEnabled" value="false">禁用</label>
											<%Else%>
												<label><input type="radio" name="GZipEnabled" value="true">启用</label>
												<label><input type="radio" name="GZipEnabled" value="false" checked>禁用</label>
											<%EndIf%>
										</td>
									</tr>
								<%EndIf%>
								<tr>
									<th>默认文档（首页）：</th>
									<td><input type="text" name="DefaultDocument" value="<%=ThisChannel[DefaultDocument]%>" size="15" maxlength="50" class="ali-input"></td>
								</tr>
								<tr>
									<th>扩展名：</th>
									<td><input type="text" name="Extension" value="<%=ThisChannel[Extension]%>" size="10" maxlength="50" class="ali-input"></td>
								</tr>
								<tr>
									<th>域名：</th>
									<td>
										<input type="text" name="Domain" value="<%=ThisChannel[Domain]%>" size="50" maxlength="150" class="ali-input"><br>
										以http://开头，以斜杠（/）结束，可以包含子目录。可绑定多个域名，多域名用"|"隔开。
									</td>
								</tr>
								<tr>
									<th>公告：</th>
									<td><textarea type="text" name="Notice" cols="60" rows="4" wrap="off" class="ali-input <%=ContentLang%>Font"><%=ThisChannel[Notice]%></textarea></td>
								</tr>
								<tr>
									<th>脚注（版权信息）：</th>
									<td><textarea type="text" name="Footer" cols="60" rows="4" wrap="off" class="ali-input <%=ContentLang%>Font"><%=ThisChannel[Footer]%></textarea></td>
								</tr>
								<tr>
									<th>统计代码：</th>
									<td><textarea type="text" name="StatCode" cols="60" rows="2" wrap="off" class="ali-input"><%=ThisChannel[StatCode]%></textarea></td>
								</tr>
								<tr>
									<th>栏目大标志：</th>
									<td>
										<input type="text" name="Logo" value="<%=ThisChannel[Logo]%>" size="55" class="ali-input"><a class="ali-button ali-uploader">浏览...</a>
										<a href="<%=ThisChannel[Logo]%>" target="_blank"><img src="<%=ThisChannel[Logo]%>" height="22" alt="网站大标志"></a>
									</td>
								</tr>
								<tr>
									<th>栏目小标志：</th>
									<td>
										<input type="text" name="Link" value="<%=ThisChannel[Link]%>" size="55" class="ali-input"><a class="ali-button ali-uploader">浏览...</a>
										<a href="<%=ThisChannel[Link]%>" target="_blank"><img src="<%=ThisChannel[Link]%>" height="22" alt="网站小标志"></a>
									</td>
								</tr>
								<%If !Guid.Equals(ThisChannel[InstanceID], Guid.Empty)%>
									<tr>
										<th>启用可视编辑：</th>
										<td>
											<%If Convert.ToInt32(ThisChannel[VisualEdit]) == 1%>
												<label><input type="radio" name="VisualEdit" value="0">禁用</label>
												<label><input type="radio" name="VisualEdit" value="1" checked>静态</label>
												<label><input type="radio" name="VisualEdit" value="2">动态</label>
											<%ElseIf Convert.ToInt32(ThisChannel[VisualEdit]) == 2%>
												<label><input type="radio" name="VisualEdit" value="0">禁用</label>
												<label><input type="radio" name="VisualEdit" value="1">静态</label>
												<label><input type="radio" name="VisualEdit" value="2" checked>动态</label>
											<%Else%>
												<label><input type="radio" name="VisualEdit" value="0" checked>禁用</label>
												<label><input type="radio" name="VisualEdit" value="1">静态</label>
												<label><input type="radio" name="VisualEdit" value="2">动态</label>
											<%EndIf%>
											<ol>
												<li>如果是动态，并且栏目路径中不包含正则表达式，则设置name为ID，value为栏目路径后的第一个目录名称。</li>
												<li>如果是动态，并且栏目路径中包含正则表达式，则设置name为正则名称，value为正则匹配值。</li>
												<li>栏目所属的模块的InstanceConfig对象必须包含GetVisualEditFolder(name, value, checkRight)的函数，它返回可视编辑目录路径。</li>
											</ol>
										</td>
									</tr>
								<%EndIf%>
								<tr>
									<th>栏目菜单：</th>
									<td>
										<%If Convert.ToBoolean(ThisChannel[EnableMenu])%>
											<label><input type="radio" name="EnableMenu" value="true" checked="checked">启用</label>
											<label><input type="radio" name="EnableMenu" value="false" >禁用</label>
										<%Else%>
											<label><input type="radio" name="EnableMenu" value="true" >启用</label>
											<label><input type="radio" name="EnableMenu" value="false" checked="checked">禁用</label>
										<%EndIf%>
									</td>
								</tr>
								<tr style="display:none">
									<th>导航位置：</th>
									<td>
										<%If Convert.ToString(ThisChannel[NavPosition]) == "Top"%>
											<label><input type="radio" name="NavPosition" value="Top" checked="checked">顶部</label>
											<label><input type="radio" name="NavPosition" value="Left">左侧</label>
										<%Else%>
											<label><input type="radio" name="NavPosition" value="Top">顶部</label>
											<label><input type="radio" name="NavPosition" value="Left" checked="checked">左侧</label>
										<%EndIf%>
									</td>
								</tr>
								<tr style="display:none">
									<th>侧栏导航样式：</th>
									<td>
										<%If Convert.ToString(ThisChannel[SideNavStyle]) == "Tree"%>
											<label><input type="radio" name="SideNavStyle" value="Tree" checked="checked">树型</label>
											<label><input type="radio" name="SideNavStyle" value="Accordion" >折叠型</label>
										<%Else%>
											<label><input type="radio" name="SideNavStyle" value="Tree">树型</label>
											<label><input type="radio" name="SideNavStyle" value="Accordion" checked="checked">折叠型</label>
										<%EndIf%>
									</td>
								</tr>
								<tr style="display:none">
									<th>管理员角色：</th>
									<td><input type="text" name="AdminRole" value="<%=ThisChannel[AdminRole]%>" size="30" class="ali-input"></td>
								</tr>
								<tr style="display:none">
									<th>辅助登陆路径：</th>
									<td><input type="text" name="LoginPath" value="<%=ThisChannel[LoginPath]%>" size="50" class="ali-input"></td>
								</tr>
								<tr>
									<th>搜索引擎优化：</th>
									<td>
										页面关键字：<input type="text" name="MetaKeywords" value="<%=ThisChannel[MetaKeywords]%>" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
										页面描述：<input type="text" name="MetaDescription" value="<%=ThisChannel[MetaDescription]%>" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
									</td>
								</tr>
							<%EndIf%>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">保 存</button><input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp|png"></div>
	</form>
</section>